#ifndef CODEC_BITSTREAM_H
#define CODEC_BITSTREAM_H

#define BITSTREAM_MB_COD	0x01
#define BITSTREAM_MB_MCBPC	0x02
#define BITSTREAM_MB_CBPY	0x04
#define BITSTREAM_MB_DQUANT	0x08
#define BITSTREAM_MB_MVD	0x10
#define BITSTREAM_MB_MVDB	0x20
#define BITSTREAM_MB_MVD24	0x40

// indexed by [PCType][MBtype]
const static int bitstream_field_mb[2][7] = {
 {0,
  0,
  0,
  BITSTREAM_MB_MCBPC | BITSTREAM_MB_CBPY, 
  BITSTREAM_MB_MCBPC | BITSTREAM_MB_CBPY | BITSTREAM_MB_DQUANT, 
  0,
  0}, // PCT_INTRA
 {BITSTREAM_MB_COD | BITSTREAM_MB_MCBPC | BITSTREAM_MB_CBPY | BITSTREAM_MB_MVD,
  BITSTREAM_MB_COD | BITSTREAM_MB_MCBPC | BITSTREAM_MB_CBPY | BITSTREAM_MB_DQUANT | BITSTREAM_MB_MVD,
  BITSTREAM_MB_COD | BITSTREAM_MB_MCBPC | BITSTREAM_MB_CBPY | BITSTREAM_MB_MVD | BITSTREAM_MB_MVD24,
 BITSTREAM_MB_COD | BITSTREAM_MB_MCBPC | BITSTREAM_MB_CBPY,
 BITSTREAM_MB_COD | BITSTREAM_MB_MCBPC | BITSTREAM_MB_CBPY | BITSTREAM_MB_DQUANT,
 BITSTREAM_MB_COD | BITSTREAM_MB_MCBPC | BITSTREAM_MB_CBPY | BITSTREAM_MB_DQUANT | BITSTREAM_MB_MVD | BITSTREAM_MB_MVD24,
 BITSTREAM_MB_COD | BITSTREAM_MB_MCBPC,}, // PCT_INTER
 
};

int read_h263_picture(int pictpos, PICTURE *pic);
#endif
